#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void fun(int a[], int n)
{
	int b[10001];
	int c[10001];
	int j = 0;
	int count1 = 0;
	int count2 = 0;
	for (int i = 0; i<n; i++)
	{
		if (1 == a[i] % 2)
		{
			b[count1] = a[i];
			count1++;
		}
		else if (0 == a[i] % 2)
		{
			c[count2] = a[i];
			count2++;
		}
	}
	for (int i = 0; i<count1; i++)
	{
		printf("%d ", b[i]);
	}
	for (int i = 0; i<count2; i++)
	{
		printf("%d ", c[i]);
	}
}

int main(int argc, char *argv[])
{
	int n = 0;
	int a[10001];
	scanf_s("%d", &n);
	for (int i = 0; i<n; i++)
	{
		scanf_s("%d", &a[i]);
	}
	fun(a, n);
	return 0;
}